package com.hkd.common.api.enums;

/**
 * @author HKD
 * @date 2022/9/17 19:58
 */
//证件类型
public enum IdentityCardType {
    //身份证
    ID_CARD(1),
    //军官证
    MILITARY_CARD(2),
    //护照
    PASSPORT(3)
    ;

    IdentityCardType(Integer code) {
        this.code = code;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    private Integer code;

    public static IdentityCardType search(Integer code){
        IdentityCardType[] values = values();
        for (IdentityCardType value : values) {
            if (value.getCode().equals(code)){
                return value;
            }
        }
        return null;
    }
}
